/*
 * BrokerQueue.h
 *
 */

#ifndef BROKERQUEUE_H_
#define BROKERQUEUE_H_

#include "../channel_common/ChannelCommon.h"
#include "../IPC/MessageQueue.h"

namespace channel {

class BrokerQueue {
public:
	BrokerQueue(std::string brokerName);
	virtual ~BrokerQueue();

    /**
     */
    static void create(std::string brokerName);

    /**
     */
    static void destroy(std::string brokerName);

    /**
     *
     */
    void recvFromReceiver(int receiverId,channel::ChannelMessage &message);

    /**
     *
     */
    void sendToTransmiter(int transmiterId,channel::ChannelMessage &message);


private:
	static const std::string CHANNEL_QUEUE_PATH;
	static const char CHANNEL_QUEUE_KEY = 'a';

private:
	ipc::MessageQueue<channel::ChannelMessage> m_queue;

};

} /* namespace channel */
#endif /* BROKERQUEUE_H_ */
